from django.forms import ModelForm

from capabilities import formfield_callbacks

from xfn.models import XFN

class XFNForm(ModelForm):
    formfield_callback = formfield_callbacks.html5
    
    def __init__(self, *args, **kwargs):
        super(XFNForm, self).__init__(*args, **kwargs)
        self.fields['name'].widget.attrs['autofocus'] = 'autofocus'

    class Meta:
        model = XFN